package eu.flexblog.modules.users.view
{
	import eu.flexblog.modules.users.model.UsersProxy;
	import eu.flexblog.modules.users.view.components.Users;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.mediator.Mediator;
	
	public class UsersMediator extends Mediator
	{
		public static const NAME:String = 'UsersMediator';
		
		private var usersProxy:UsersProxy;
		
		public function UsersMediator(viewComponent:Users)
		{
			super(NAME, viewComponent);
			
			
					
		}
		
		override public function initializeNotifier(key:String):void
		{
			super.initializeNotifier(key);
			
			usersProxy = facade.retrieveProxy(UsersProxy.NAME)as UsersProxy;
			users.usersData = usersProxy.getUserList();
		} 
		
		override public function listNotificationInterests():Array
		{
			return [
			       ];
		}
		
		override public function handleNotification(note:INotification):void
		{
			/* switch ( note.getName() )
			{
				case ApplicationFacade.ADD_COMP:
					widgetCanvas.addChild( note.getBody() as DisplayObject );
					break;
					
				case ApplicationFacade.REMOVE_COMP:
					widgetCanvas.removeChild( note.getBody() as DisplayObject );
					break;
			} */
		}
		
		protected function get users():Users
		{
			return viewComponent as Users;
		}
		
	}
}